package com.yswy.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yswy.common.enums.TfPlatformEnums;
import com.yswy.common.enums.XtPlatformEnums;
import com.yswy.common.enums.base.TypeEnum;
import com.yswy.domain.common.BasePojo;
import com.yswy.domain.entity.user.User;
import com.yswy.domain.vo.gld.addOrUpate.PackageManageAddOrUpdate;
import com.yswy.domain.vo.gld.addOrUpate.PackageVersionAddOrUpdate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@Api(tags = "渠道包")
@TableName(value = "package_manage")
public class PackageManage extends BasePojo<PackageManage> {
    @ApiModelProperty("项目ID")
    private Long projectId;
    @ApiModelProperty("项目名字")
    @TableField(exist = false)
    private String projectName;

    @ApiModelProperty("渠道")
    private String channel;
    @ApiModelProperty("系统平台  0 android  1 ios")
    private String xtPlatform;
    @ApiModelProperty("投放（上架）平台  0 巨量  1 快手 ")
    private String tfPlatform;

    @ApiModelProperty("附加字段")
    private String  appendInformation ;


    public PackageManage(PackageManageAddOrUpdate res , User user) {
        this.projectId = res.getProjectId();

        this.channel = res.getChannel();
        TypeEnum xtPlatformEnum = TypeEnum.messageOf(XtPlatformEnums.class , res.getXtPlatform());
        String xtPlatform = xtPlatformEnum.toString();
        this.xtPlatform =xtPlatform;
        TypeEnum tfPlatformEnum = TypeEnum.messageOf(TfPlatformEnums.class , res.getTfPlatform());
        String tfPlatform = tfPlatformEnum.toString();
        this.tfPlatform =tfPlatform;
        this.appendInformation = res.getAppendInformation() ;
        super.setCreateBy(user.getId().longValue());
    }
    public PackageManage() {

    }

}
